<?php
/*
* Author: Nguyen Hai Nam
* Module: AboutUsModule
* Desc	: Introduce pick.vn and sidle pic
* Date	: 12/12/2011
*/
class SiteMapModule extends Pick_Core_Module{
	function SiteMapModule(){
		parent::Pick_Core_Module();
		# Languages
		$languages = new Pick_Core_Languages();
		$objectLanguages = "";
		$objectLanguages = $languages->getObjects(1, 'status = 1', array('position'=>'ASC'), '');
		if($objectLanguages){
			$objectLanguages = $objectLanguages['data'];	
		}#endif
		$this->template->assign("objectLanguages", $objectLanguages);
	}
	public function getContent(){

		$statics = new Pick_Dao_Statics();
		$slug = $this->request->get('slug', 'corporate-profile');
		if($slug){
			
			$objStatic = $statics->getObjectFromSlug($slug);
			$this->template->assign('objStatic', $objStatic);
			
		}
		// Get product
		$productcategory = new Pick_Dao_ProductCategory();
		$product = new Pick_Dao_Product();
		$arrObjCategory =  $productcategory->getSubCategoryHome(0);
		$this->template->assign('arrObjCategory', $arrObjCategory);
		$this->template->assign('productcategory', $productcategory);
		$this->template->assign('product', $product);
		# get R & D
		$newscategory = new Pick_Dao_NewsCategory();
		$news = new Pick_Dao_News();
		$objCategory = $newscategory->getObjectFromSlug('r-d');
		$objRandDItems = $news->getObjectsFromCId(1, $objCategory->getField('id'));
		$this->template->assign('objRandDItems', $objRandDItems);
	
		//careers
		$objCategoryCareers = $newscategory->getObjectFromSlug('careers');
		$objCareersDefault = $news->getObjectFirstOneFromCId($objCategoryCareers->getField('id'));
		$this->template->assign('objCareersDefault', $objCareersDefault);
		
		//news-media
		 $objCategory = $newscategory->getObjectFromSlug('news-media');
         $objNewsMedia= $newscategory->getObjectsFromCId(1, $objCategory->getField('id'), array('position'=>'DESC'));
		 $this->template->assign('objNewsMedia', $objNewsMedia);
		 //environment
		 $objCategory1 = $newscategory->getObjectFromSlug('environment');
		 $objEnviroment = $news->getObjectsFromCId(1, $objCategory1->getField('id'));
         print_v($objEnviroment);die();
		 $this->template->assign('objEnviroment', $objEnviroment);
		 //
		$this->template->assign('slug', $slug);
	}
}